'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.get('/', controller.home.index);
  router.post('/reg', controller.user.reg);
  router.post('/login', controller.user.login);
  router.post('/logout', controller.user.logout);
  router.post('/upload', controller.file.upload);
  router.get('/getsize', controller.user.getSize);
  router.get('/getlist', controller.file.list);
  router.post('/getlist/createdir', controller.file.createdir);
  router.post('/getlist/rename', controller.file.rename);
  router.post('/getlist/delete', controller.file.delete);
  router.get('/getlist/search', controller.file.search);
  router.post('/share/create', controller.share.create);
  router.get('/share/list', controller.share.list);
  router.get('/share/:sharedurl', controller.share.read);
  router.post('/share/save_to_self', controller.share.saveToSelf);
  router.get('/sharepage/:sharedurl', controller.share.readpage);
};
